package com.mujin.keji.collectionsystem.utils.ImageLoader.glide;

import android.net.Uri;

import com.bumptech.glide.load.Transformation;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.animation.ViewPropertyAnimation;
import com.mujin.keji.collectionsystem.utils.ImageLoader.base.BaseLoaderConfig;

import java.io.File;

/**
 * @author 作者：weishixiong
 * @date 创建时间：2018/5/2
 * @corporation 公司：mujin
 * @desception baseConfig基础上自定义的配置
 * 暂时添加：图片路径，缓存策略，加载动画，图片转换;可扩展
 */

public class GlideConfig extends BaseLoaderConfig {
    private DiskCacheStrategy strategy;
    private ViewPropertyAnimation.Animator animator;
    private Transformation transformation;
    private String imagePath;
    private Uri uri;
    private File file;
    private int resId;
    private byte[] imgBytes;
    
    public DiskCacheStrategy getStrategy() {
        return strategy;
    }
    
    /**
     * 默认为DiskCacheStrategy.All
     *
     * @param strategy
     * @return
     */
    public GlideConfig setStrategy(DiskCacheStrategy strategy) {
        this.strategy = strategy;
        return this;
    }
    
    public ViewPropertyAnimation.Animator getAnimator() {
        return animator;
    }
    
    public GlideConfig setAnimator(ViewPropertyAnimation.Animator animator) {
        this.animator = animator;
        return this;
    }
    
    public Transformation getTransformation() {
        return transformation;
    }
    
    public GlideConfig setTransformation(Transformation transformation) {
        this.transformation = transformation;
        return this;
    }
    
    public String getImagePath() {
        return imagePath;
    }
    
    public GlideConfig setImagePath(String imagePath) {
        this.imagePath = imagePath;
        return this;
    }
    
    public Uri getUri() {
        return uri;
    }
    
    public GlideConfig setUri(Uri uri) {
        this.uri = uri;
        return this;
    }
    
    public File getFile() {
        return file;
    }
    
    public GlideConfig setFile(File file) {
        this.file = file;
        return this;
    }
    
    public int getResId() {
        return resId;
    }
    
    public GlideConfig setResId(int resId) {
        this.resId = resId;
        return this;
    }
    
    public byte[] getImgBytes() {
        return imgBytes;
    }
    
    public GlideConfig setImgBytes(byte[] imgBytes) {
        this.imgBytes = imgBytes;
        return this;
    }
}
